package weektwo_day03_utils;

public class Format {
	// paramsStrings: 0->scp;1->inputPath;2->ip;3->outputPath
	public static String[] formatString(String str){
		String[] formatedtString = new String[4];
		String[] params = str.split(" ");
		String[] splits = params[2].split(":");
		String fileNameString = params[1].substring(params[1].lastIndexOf("/")+1);

		formatedtString[0] = params[0];
		formatedtString[1] = params[1];
		formatedtString[2] = splits[0];
		if(splits[1].length()==1){
			formatedtString[3] = fileNameString;
		}else{
			formatedtString[3] = params[1];
		}
		return formatedtString;
	}
}
